<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="./../../template/tagedu.xhtml">

    <ui:define name="title">
        <title><h:outputText value="Gerenciar Campanhas - TAG"/></title>
    </ui:define>

    <ui:define name="content">
        <h:outputText styleClass="enrollmentName" value="Gerenciar Campanhas"/>
        <h:form id="campaignManageForm">
            <p:messages id="message"/>
            
            <p:dataTable id="dataTableAlunos" var="campaign" value="#{campaignManagerB.loadCampaignList()}">  
                
                <f:facet name="header">  
                    Campanhas 
                </f:facet>  

                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Nome" />  
                    </f:facet>  
                    <p:inplace  editor="true">
                        <p:inputText value="#{campaign.name}" />  
                    </p:inplace>
                    
                </p:column>
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Data Inicial" />  
                    </f:facet>
                    <center>
                        <h:outputText value="#{campaign.initialDate.time}"  />           
                    </center>
                    
                </p:column> 
                 <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Data Terminal" />  
                    </f:facet>

                    <center>
                        <h:outputText value="#{campaign.terminalDate.time}"  />               
                    </center>
                    
                </p:column>
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="Tipo da Campanha" />  
                    </f:facet>

                    <center>
                        <h:outputText value="#{campaign.type}"  />                 
                    </center>
                    
                </p:column> 
                </p:dataTable><br/>
            
                <p:commandButton id="bottomSave"   
                                 action="#{campaignManagerB.saveChanges()}" 
                                 value="Salvar"/>
        </h:form>
    </ui:define>
</ui:composition>
